﻿package com.bizmlib.utils.sets
{
	import flash.events.*
	
	
	public class SetManager extends EventDispatcher
	{
		
		private var __itemNodeName:String = "";
		private var __keyAttribute:String = "id";
		
		
		public function SetManager()
		{
		}
	
	
		public function set itemNodeName(value:String):void
		{
			__itemNodeName = value;
		}
		public function get itemNodeName():String
		{
			return __itemNodeName;
		}
		public function set keyAttribute(value:String):void
		{
			__keyAttribute = value;
		}
		public function get keyAttribute():String
		{
			return __keyAttribute;
		}
		
		
		public function parseXML(newXML:XML, oldXML:XML):void
		{
		}
		public function parseArray(newItemsList:Array, oldItemsList:Array):void
		{
		}
	
		
		private function siftOutNodes(xml:XML):Array
		{
			var localResultArray:Array = new Array();
			
			for each(var item:XML in xml.children())
			//for(var i:Number=0; i<parentNode.childNodes.length; i++)
			{
				if(item.localName()==itemNodeName)
				//if(parentNode.childNodes[i].nodeName==itemNodeName)
				{
					//localResultArray.push(parentNode.childNodes[i]);
					localResultArray.push(item);
				}
			}
			
			return localResultArray;
		}
	
	}
}